class SingleMode {

    private static instance: SingleMode;

    private constructor(public name: string) {

    }

    public static getInstance() {
        if (!this.instance) {
            this.instance = new SingleMode('longmo');
        }
        return this.instance;
    }
}

let a = SingleMode.getInstance();
let b = SingleMode.getInstance();
console.log(a == b);
console.log(a.name);
